package com.benny_driving_dri.act.dialog;

import java.util.List;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.benny_driving_dri.R;
import com.benny_driving_dri.entity.WithdrawRec;

public class DrawRecDialog extends Dialog {
	private List<WithdrawRec> list = null;
	private Context context = null;
	private int position;

	private TextView name, formID, bankCard, appMoney, payMoney, appTime,
			payTime, payState, back;

	public DrawRecDialog(Context context, List<WithdrawRec> list, int position) {
		super(context);
		this.context = context;
		this.list = list;
		this.position = position;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.dialog_drawrec);
		initView();
	}

	private void initView() {
		name = (TextView) findViewById(R.id.DrawDog_tv_DriName);
		formID = (TextView) findViewById(R.id.DrawDog_tv_FormID);
		bankCard = (TextView) findViewById(R.id.DrawDog_tv_BankCard);
		appMoney = (TextView) findViewById(R.id.DrawDog_tv_AppMoney);
		payMoney = (TextView) findViewById(R.id.DrawDog_tv_PayMoney);
		appTime = (TextView) findViewById(R.id.DrawDog_tv_AppTime);
		payTime = (TextView) findViewById(R.id.DrawDog_tv_PayTime);
		payState = (TextView) findViewById(R.id.DrawDog_tv_PayState);
		back = (TextView) findViewById(R.id.DrawDog_tv_Back);

		name.setText(list.get(position).getName());
		formID.setText(list.get(position).getId());
		bankCard.setText(list.get(position).getCardID());
		appMoney.setText(list.get(position).getCost());
		payMoney.setText(list.get(position).getCost());
		appTime.setText(list.get(position).getTime());
		payTime.setText(list.get(position).getTime());
		payState.setText(list.get(position).getState());
		back.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				DrawRecDialog.this.dismiss();
			}
		});
	}
}
